Skip to main content

Registering as Delegated Representative (DReps)

Delegated representatives (DReps) serve as the community's spokesperson, actively participating in voting on governance actions and advocating for the community's collective interests. DReps hold significant responsibilities in the governance process, voting on important system updates. Approval depends on the governance action type and requires a majority vote from the corresponding governance bodies.

DReps can register on chain using Ed25519 keys, Simple scripts or Plutus scripts.

Register a Key-based DRep

Generate DRep keys:

cardano-cli conway governance drep key-gen \
--verification-key-file drep.vkey \
--signing-key-file drep.skey

This returns the keys wrapped on text envelopes:

{
"type": "DRepSigningKey_ed25519",
"description": "Delegated Representative Signing Key",
"cborHex": "5820eba7053fdc9cb3b8aacf142d3d4ad575bb48fb92f4082d81605ac8e2ccfead5d"
}
{
"type": "DRepVerificationKey_ed25519",
"description": "Delegated Representative Verification Key",
"cborHex": "5820c19e0e939609531cfd04dcfa5bf1a5f3e245aa88e163759341aba296af34cc7e"
}

Generate the DRep Id:

The hash of the verification key is the DRep ID, get it with:

cardano-cli conway governance drep id \
--drep-verification-key-file drep.vkey \
--output-format hex
687c9849e1792f9b43d2a78153c412406950ee0c6f2b417226da9dcc

Or in bech32 format

cardano-cli conway governance drep id \
--drep-verification-key-file drep.vkey \
--output-format bech32
drep124w9k5ml25kcshqet8r3g2pwk6kqdhj79thg2rphf5u5urve0an

Prepare the DRep metadata file:

DReps have the option to include metadata in their registration certificate to convey their motivations and positions regarding the current and future state of the Cardano blockchain. Stakeholders looking to delegate their voting power can review this metadata to make informed decisions about whom to delegate their vote to. CIP-119 provides a specification for off-chain DReps metadata.

To add metadata to the registration certificate, you need to provide an anchor, which is a URL pointing to the metadata payload, along with a hash of the metadata content.

In this example we use the test vector of CIP119.

Get the metadata hash:

Download the metadata from its URL:

wget https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld

Use cardano-cli or b2sum to get its hash

cardano-cli conway governance drep metadata-hash \
--drep-metadata-file drep.jsonld

a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de
b2sum -l 256 drep.jsonld 
a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de drep.jsonld

Generate the DRep registration certificate:

Registering a DRep requires a deposit, query the protocol parameters to find the amount:

cardano-cli query protocol-parameters | jq .dRepDeposit
500000000

Generate the certificate Using the drep.vkey file:

cardano-cli conway governance drep registration-certificate \
--drep-verification-key-file drep.vkey \
--key-reg-deposit-amt 500000000 \
--drep-metadata-url https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld \
--drep-metadata-hash a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de \
--out-file drep-reg.cert

Or using the DRep verification key:

cardano-cli conway governance drep registration-certificate \
--drep-verification-key c19e0e939609531cfd04dcfa5bf1a5f3e245aa88e163759341aba296af34cc7e \
--key-reg-deposit-amt 500000000 \
--drep-metadata-url https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld \
--drep-metadata-hash a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de \
--out-file drep-reg.cert

Or using the DRep ID:

cardano-cli conway governance drep registration-certificate \
--drep-key-hash "$(< drep.id)" \
--key-reg-deposit-amt 500000000 \
--drep-metadata-url https://raw.githubusercontent.com/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld \
--drep-metadata-hash a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de \
--out-file drep-reg.cert

Any of the above methods produces drep-reg.cert in a text envelope:

{
"type": "CertificateConway",
"description": "DRep Key Registration Certificate",
"cborHex": "84108200581c555c5b537f552d885c1959c714282eb6ac06de5e2aee850c374d394e1a1dcd650082785e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f63617264616e6f2d666f756e646174696f6e2f434950732f6d61737465722f4349502d303131392f6578616d706c65732f647265702e6a736f6e6c645820a14a5ad4f36bddc00f92ddb39fd9ac633c0fd43f8bfa57758f9163d10ef916de"
}

Submit the Registration certificate in a transaction:

Build the transaction. Note that we use --witness-override 2 because this tranaction will contain 2 signatures, with the payment.skey and with the drep.skey.

cardano-cli conway transaction build \
--tx-in $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
--change-address $(< payment.addr) \
--certificate-file drep-reg.cert \
--witness-override 2 \
--out-file tx.raw

Sign it with payment and DRep signing keys:

cardano-cli conway transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
--signing-key-file drep.skey \
--out-file tx.signed

Submit it to the chain:

cardano-cli conway transaction submit \
--tx-file tx.signed

Query the DRep state to confirm:

cardano-cli conway query drep-state  --all-dreps


cardano-cli conway query drep-state --drep-key-hash 687c9849e1792f9b43d2a78153c412406950ee0c6f2b417226da9dcc
[
[
{
"keyHash": "687c9849e1792f9b43d2a78153c412406950ee0c6f2b417226da9dcc"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 188
}
]
]